<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

// 这个会导致创建的表是 tb_tb_menu。第一个 tb_ 是 database 中配置的 prefix。
// php artisan make:migration create_menu_table --create=tb_menu
class CreateMenuTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('menu', function (Blueprint $table) {
            $table->id();
            // $table->timestamps();
            $table->timestamp('create_time')->nullable();
            $table->timestamp('update_time')->nullable();
            $table->timestamp('delete_time')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('menu');
    }
}
